package cn.xorange.commons.utils.thirdApp.entity;


/**
 * @author yangjian
 */

public enum WxErrorCode {

    ACCESS(0,"请求成功","",""),
    ERROR(-1,"系统繁忙，此时请开发者稍候再试","","system error"),
    ERR_40001(40001,"AppSecret 错误或者","","invalid credential  access_token isinvalid or not latest"),
    ERR_40002(40002,"请确保 grant_type 字段值为 client_credential","auth.getAccessToken","获取小程序全局唯一后台接口调用凭据（access_token）有效期2小时"),
    ERR_40003(40003,"openid 错误","",""),
    ERR_40013(40013,"不合法的 AppID","","invalid appid"),

    ERR_40029(40029,"code 无效","auth.code2Session","登陆-获取openId"),
    ERR_40037(40037,"模板id不正确，weapp_template_msg.template_id或者mp_template_msg.template_id","uniformMessage.send","下发小程序和公众号统一的服务消息"),

    ERR_40125(40029,"不合法的 secret","","请检查 secret 的正确性，避免异常字符，注意大小写"),
    ERR_40163(40163,"code been used","WxCode2Session",""),
    ERR_40164(40164,"调用接口的IP地址不在白名单中","",""),
    ERR_40243(40243,"AppSecret已被冻结，请登录小程序平台解冻后再次调用。","",""),

    ERR_41028(41028,"weapp_template_msg.form_id过期或者不正确","uniformMessage.send","下发小程序和公众号统一的服务消息"),
    ERR_41029(41029,"weapp_template_msg.form_id已被使用","uniformMessage.send","下发小程序和公众号统一的服务消息"),
    ERR_41030(41030,"weapp_template_msg.page不正确","uniformMessage.send","下发小程序和公众号统一的服务消息"),

    ERR_45009(45009,"接口调用超过限额","uniformMessage.send","下发小程序和公众号统一的服务消息"),
    ERR_45011(45011,"频率限制，每个用户每分钟100次","auth.code2Session","登陆-获取openId"),

    ERR_50004(50004,"禁止使用 token 接口","",""),
    ERR_50007(50007,"账号已冻结","",""),
    ERR_61024(61024,"第三方平台 API 需要使用第三方平台专用 token","",""),

    ERR_87014(87014,"内容可能潜在风险","security.imgSecCheck/msgSecCheck","校验是否含有违法违规内容"),
    ERR_89002(89002,"没有绑定开放平台帐号","auth.getPaidUnionId","用户信息-支付完后获取用户unionid"),
    ERR_89300(89300,"订单无效","auth.getPaidUnionId","用户信息-支付完后获取用户unionid"),
    ERR_101001(101001,"certificate not found","","证件信息未找到");


    private Integer code;
    private String msg;
    private String apiName;
    private String apiRemark;

    WxErrorCode(Integer code, String msg, String apiName, String apiRemark){
        this.code = code;
        this.apiName = apiName;
        this.msg = msg;
        this.apiRemark = apiRemark;
    }

    public Integer getCode(){
        return this.code;
    }
    public String getMsg(){
        return this.msg;
    }

}
